Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

308: Add skeleton loading component #378

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from
Draft

308: Add skeleton loading component #378

wants to merge 1 commit into from

Conversation

aaron-nance
Copy link
Contributor

Need to do more work with storybook and see what tests to add, but the code is here and mimics what was done in the Marko versions.

@@ -0,0 +1,112 @@
export type NativeTags =
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is based on Marko.NativeTags

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

React has keyof React.JSX.IntrinsicElements, we should use that instead. But I think skin supports div and span only as per documentation

@@ -0,0 +1,21 @@
import React, { ComponentProps, FC } from 'react'

Check warning

Code scanning / ESLint

Disallow unused variables Warning

'ComponentProps' is defined but never used.

Copilot Autofix AI 24 days ago

To fix the problem, we need to remove the unused import ComponentProps from the import statement on line 1. This will resolve the ESLint error and clean up the code by removing unnecessary imports.

Suggested changeset 1
src/ebay-skeleton/ebay-skeleton-avatar.tsx

Autofix patch

Autofix patch
Run the following command in your local git repository to apply this patch
cat << 'EOF' | git apply
diff --git a/src/ebay-skeleton/ebay-skeleton-avatar.tsx b/src/ebay-skeleton/ebay-skeleton-avatar.tsx
--- a/src/ebay-skeleton/ebay-skeleton-avatar.tsx
+++ b/src/ebay-skeleton/ebay-skeleton-avatar.tsx
@@ -1,2 +1,2 @@
-import React, { ComponentProps, FC } from 'react'
+import React, { FC } from 'react'
 import classNames from 'classnames'
EOF
@@ -1,2 +1,2 @@
import React, { ComponentProps, FC } from 'react'
import React, { FC } from 'react'
import classNames from 'classnames'
Copilot is powered by AI and may make mistakes. Always verify output.
Positive Feedback
Negative Feedback

Provide additional feedback

Please help us improve GitHub Copilot by sharing more details about this comment.

Please select one or more of the options
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

seems like valid concern.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

eslint should have got this, we need to understand why not

import React, { ComponentProps, FC } from 'react'
import classNames from 'classnames'

export type Props = ComponentProps<'div'> & {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[trivial] other components are exporting types in a separate file


export type Props = ComponentProps<'div'>

const EbaySkeletonText: FC<Props> = ({
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should be EbaySkeletonTextbox?

@@ -0,0 +1,21 @@
import React, { ComponentProps, FC } from 'react'
import classNames from 'classnames'
import { NativeTags } from './nativeTags'
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should use the react type instead:

    as?: keyof React.JSX.IntrinsicElements;

But I think skin supports div and span only

className,
...rest
}) => (
<div
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It needs to support the as also

className,
...rest
}) => (
<div
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It needs to support as also

multiline,
...rest
}) => (
<div
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It needs to support as also

className,
...rest
}) => (
<div
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It needs to support as also

@@ -0,0 +1,112 @@
export type NativeTags =
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

React has keyof React.JSX.IntrinsicElements, we should use that instead. But I think skin supports div and span only as per documentation

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants